(function() {
  var username = sessionStorage.getItem('username') || localStorage.getItem('username')
  var admin = $('#admin')
  if (!username) {
    location.href = 'login.html'
  } else {
    admin.html('欢迎您 , ' + username);
  }
})()

$('#logoutBtn').on('click', function () {
  localStorage.removeItem('username');
  sessionStorage.removeItem('username')
  location.href = 'login.html'
})